﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE80;
using EnvDTE;


namespace iMainAddin
{
	namespace iItem
	{
        public enum eNewSolutionContext
        {
            // 위자드 타입은 = 0;
            ProjectName = 1,
            LocalDirectory,
            InstallationDirectory,
            FExclusive,
            SolutionName,
            Silent,
        }
        public enum eVcAddItemContext
        {
            // 위자드 타입은 = 0;
            ProjectName = 1,
            ProjectItems,
            LocalDirectory,
            ItemName,
            InstallationDirectory,
            Silent,
        }
        public class iSolutionInfo : iWizardInfo
        {
            protected bool m_bFexclusive;
            protected string m_sSoluitionName;
            public override void SetContext(ref object[] contextParams)
            {
                m_eWizardType = eType.CplusProject;
                m_sProjectName = contextParams[(int)eNewSolutionContext.ProjectName].ToString();
                m_sLocalDirectory = contextParams[(int)eNewSolutionContext.LocalDirectory].ToString();
                m_sInstallationDirectory = contextParams[(int)eNewSolutionContext.InstallationDirectory].ToString();
                m_bFexclusive = (bool)contextParams[(int)eNewSolutionContext.FExclusive];
                m_sSoluitionName = contextParams[(int)eNewSolutionContext.SolutionName].ToString();
                //m_bSilent = (bool)contextParams[(int)eNewSolutionContext.Silent];
            }
        }
        public class iItemInfo : iWizardInfo
        {
            protected ProjectItems m_rProjectItems;
            protected string m_sItemName;
            public override void SetContext(ref object[] contextParams)
            {
                m_eWizardType = eType.CplusClass;
                m_sProjectName = contextParams[(int)eVcAddItemContext.ProjectName].ToString();
                m_rProjectItems = (ProjectItems)contextParams[(int)eVcAddItemContext.ProjectItems];
                m_sLocalDirectory = contextParams[(int)eVcAddItemContext.LocalDirectory].ToString();
                m_sItemName = contextParams[(int)eVcAddItemContext.ItemName].ToString();
                m_sInstallationDirectory = contextParams[(int)eVcAddItemContext.InstallationDirectory].ToString();
                //m_bSilent = (bool)contextParams[(int)eVcAddItemContext.Silent];
            }

            public ProjectItem GetProjectItem(int nIndex)
            {
                if (nIndex < this.m_rProjectItems.Count && nIndex >= 0)
                    return this.m_rProjectItems.Item(nIndex);

                return null;
            }
            public ProjectItem GetProjectItem(string sItemName)
            {
                return this.m_rProjectItems.Item(sItemName);
            }
            public int GetProjectItemCount()
            {
                return m_rProjectItems.Count;
            }

            #region public Properties

            public ProjectItems rProjectItems
            {
                get
                {
                    return this.m_rProjectItems;
                }
                set
                {
                    this.m_rProjectItems = value;
                }
            }
            public string sItemName
            {
                get
                {
                    return this.m_sItemName;
                }
                set
                {
                    this.m_sItemName = value;
                }
            }
            #endregion
        }
    }
}